//
//  UIImage+extension.m
//  netEasy
//
//  Created by mac on 15/11/1.
//  Copyright © 2015年 mac. All rights reserved.
//

#import "UIImage+extension.h"

@implementation UIImage (extension)
+(instancetype)imageWithColor:(UIColor *) color{

    //1.开起图形上下文
    UIGraphicsBeginImageContext(CGSizeMake(100, 100));
    
    //2.在图形上下文中画出矩形框
    [color set];
    UIRectFill(CGRectMake(0, 0, 100, 100));
    
    //3.获得图片
    UIImage * image = UIGraphicsGetImageFromCurrentImageContext();
    
    //4.关闭当前图形上下文
    UIGraphicsEndImageContext();
    
    return image;
}


@end
